$(function () {
    $("#jqGrid").jqGrid({
        url: baseURL + 'addmtg/findAddMtgData',
        datatype: "json",
        colModel: [
            { label: '姓名', name: 'name', width: 60,sortable:false },
    /*        { label: '性别', name: 'sex', width: 75,formatter: function(value, options, row){
                return value === 0 ?
                    '男' :
                    '女';
            }},*/
            { label: '手机号', name: 'mobile' , width: 80,sortable:false},
            { label: '认证时间', name: 'updateTime', width: 110,sortable:false}
        ],
        viewrecords: false,

        rowNum: 10,
        rowList : [10,30,50,100],
        rownumbers: false,
        rownumWidth: 25,
        autowidth:true,
        multiselect: false,
        pager: "#jqGridPager",
        jsonReader : {
            root: "page.list",
            page: "page.currPage",
            total: "page.totalPage",
            records: "page.totalCount"
        },
        prmNames : {
            page:"page",
            rows:"limit",
        },
        gridComplete:function(){
            //隐藏grid底部滚动条
            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({ "overflow-x" : "hidden" });
        }
    });
    $('.form-horizontal').validationEngine('attach',{
        autoHidePrompt: true,
        autoHideDelay: 2000,
        maxErrorsPerField: 1
    });
});

var vm = new Vue({
    el:'#rrapp',
    data:{
    	options:[
            {
                name:'未认证',
                value:1
            },
            {
                name:'已认证',
                value:2
            },
            {
                name:'完善认证',
                value:3
            }
        ],
    	q:{
    		typeStatus:1
    	}
    },
    
    methods: {
        query: function () {
            vm.reload();
        },
        reload: function () {
            vm.showList = true;
            $(".formError").hide();
            var page = $("#jqGrid").jqGrid('getGridParam','page');
            $("#jqGrid").jqGrid('setGridParam',{
            	postData:{'typeStatus': vm.q.typeStatus},
                page:page
            }).trigger("reloadGrid");
        },
        validator: function () {

        }
    }
});